
package com.wwy.monitor.service.impl;

import com.wwy.monitor.mapper.tddl.MonitorReceiverMapper;
import com.wwy.monitor.model.tddl.dto.MonitorReceiverDTO;
import com.wwy.monitor.model.tddl.query.MonitorReceiverQuery;
import com.wwy.monitor.service.MonitorReceiverService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @author tianquan.ld
 * @version V1.0
 * <p>Description: çæ§æ¥æ¶è service impl</p>
 * @date 2019-10-30 21:18
 */
@Service(value = "monitorReceiverService")
public class MonitorReceiverServiceImpl implements MonitorReceiverService {
    @Resource
    private MonitorReceiverMapper monitorReceiverMapper;

    @Override
    public boolean insert(MonitorReceiverDTO entity) {
        entity.setCreateTime(new Date());
        entity.setUpdateTime(new Date());
        return monitorReceiverMapper.insert(entity) == 1;
    }

    @Override
    public int batchInsert(List<MonitorReceiverDTO> list) {
        return monitorReceiverMapper.batchInsert(list);
    }

    @Override
    public boolean deleteById(Long id) {
        return monitorReceiverMapper.deleteById(id) == 1;
    }

    @Override
    public int deleteByDetailId(Long detailId) {
        return monitorReceiverMapper.deleteByDetailId(detailId);
    }

    @Override
    public boolean updateById(MonitorReceiverDTO entity) {
        entity.setUpdateTime(new Date());
        return monitorReceiverMapper.updateById(entity) == 1;
    }

    @Override
    public List<MonitorReceiverDTO> selectByQuery(MonitorReceiverQuery query) {
        return monitorReceiverMapper.selectByQuery(query);
    }

    @Override
    public MonitorReceiverDTO selectById(Long id) {
        return monitorReceiverMapper.selectById(id);
    }

    @Override
    public Integer count(MonitorReceiverQuery query) {
        return monitorReceiverMapper.count(query);
    }
}